package com.tengju.bff.interfaces.covercharge.constant;

import com.tengju.bff.interfaces.covercharge.service.impl.NotifyBestSignServiceImpl;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author shiliang
 * @date 2020.06.12 15:59
 * @description 通知业务实现
 */
@Getter
@AllArgsConstructor
public enum NotifyBizImplEnum {

    /**
     * 上上签-签署合同|申请证书
     */
    BIZ_IMPL_1("bestsign", "message", NotifyBestSignServiceImpl.class),


    ;


    private String channel;

    private String bizType;

    private Class clazz;


    /**
     * 获取业务实现
     */
    public static NotifyBizImplEnum getInstance(String channel, String bizType) {
        if (StringUtils.isBlank(channel) || StringUtils.isBlank(bizType)) {
            return null;
        }
        for (NotifyBizImplEnum bizImplEnum : NotifyBizImplEnum.values()) {
            if (channel.equals(bizImplEnum.getChannel()) && bizType.equals(bizImplEnum.getBizType())) {
                return bizImplEnum;
            }
        }
        return null;
    }

}
